using System;
using System.Collections.Generic;
using System.Text;

namespace BuildingBasicDomain
{
    public class Circle : IGeometry
    {
        private double radius;

        public double Radius
        {
            get
            {
                return radius;
            }
            set
            {
                radius = value;
            }
        }

        private IPoint  center;

        public IPoint Center
        {
            get { return center; }
            set { center = value; }
        }

        #region IGeometry Members

        public IPoint GetMiddle()
        {
            return Center;
        }

        #endregion

        public virtual IEnumerable<IPoint> perimeter(int numOfPoints)
        {
            IPoint point;
            for (int i = 0; i < numOfPoints;i++ )
            {
                double th = i * 2 * Math.PI / numOfPoints;
                point = new Point(Radius * Math.Sin(th), Radius * Math.Cos(th),0);
                yield return point;
            }

        }

        public Circle(double radius)
        {
            this.radius = radius;
        }
    }
}
